package com.yunduo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author ChengXin
 * @since 2023-07-12
 */
@TableName("y_good")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Good implements Serializable {

    private static final long serialVersionUID = 1L;


    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    private String name;

    private Double price;

    /**
     * 外键商品类型id
     */
    private String type;

    /**
     * 商品描述
     */
    private String description;

    /**
     * 封面路径
     */
    private String cover;

    /**
     * 商品页详细图片,保存文件id,以_分割
     */
    private String detilImg;


    //创建时间
    @TableField(fill = FieldFill.INSERT) // 在插入时自动更新数据
    private LocalDateTime gmtCreate;

    //更新时间
    @TableField(fill = FieldFill.INSERT_UPDATE) //插入和更新时更新数据
    private LocalDateTime gmtModified;
}
